package cn.wolfcode.luowowo.article.query;

import cn.wolfcode.luowowo.article.util.TravelCondition;
import cn.wolfcode.luowowo.common.query.QueryObject;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@Setter
@Getter
@ToString
public class TravelQuery extends QueryObject {

    private Long destId =-1L;
    //出行天数
    private int dayType =-1;
    //人均花费
    private int moneyType =-1;
    //出行月份
    private int monthType =-1;

    private boolean isPublic =true;

    private String orderBy = "t.createTime desc ";

    private int orderType =1;

    public TravelCondition getDay(){
        return TravelCondition.dayMap.get(dayType);
    }
    public TravelCondition getMoney(){
        return TravelCondition.moneyMap.get(moneyType);
    }
    public TravelCondition getMonth(){
        return TravelCondition.monthMap.get(monthType);
    }

    //排序
    public String getOrderBy(){
        return orderType==1?"t.createTime desc":"t.viewnum desc";
    }

}
